class Post < ActiveRecord::Base
  #Relations
  belongs_to	:forum_thread, :counter_cache => true
  belongs_to	:user, :counter_cache => true

  #Named Scopes
  named_scope :oldest_first, :order => "created_at ASC"

  #Protection
  attr_accessible :text, :forum_thread_id 

  #Validations
  validates_presence_of :user_id, :forum_thread_id, :text
  validates_length_of :text, :minimum => 10
  validates_associated :user
  validates_associated :forum_thread
end
